﻿Public Class Details
	Inherits Panel

	Sub New()
		BackColor = Color.White
	End Sub

	Private Sub Details_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
		Dim R = ClientRectangle
		R.Height -= 1
		e.Graphics.PixelOffsetMode = Drawing2D.PixelOffsetMode.None
		'e.Graphics.DrawLine(SystemPens.ButtonShadow, R.Left, R.Bottom, R.Right, R.Bottom)
	End Sub

End Class

Public Class Shadow : Inherits PictureBox

	Sub New()
		SetStyle(ControlStyles.SupportsTransparentBackColor, True)
		SetStyle(ControlStyles.Opaque, False)
		'SetStyle(ControlStyles.DoubleBuffer, True)
		SetStyle(ControlStyles.AllPaintingInWmPaint, True)
		SetStyle(ControlStyles.UserPaint, True)
		UpdateStyles()
		'DoubleBuffered = True
		BackColor = Color.Transparent
		Dim B As New Bitmap(100, 10)
		Dim G As Graphics = Graphics.FromImage(B)
		Dim o = 128
		Dim R = New Rectangle(0, 0, B.Width, B.Height)
		For y = R.Top To R.Bottom - 1
			G.DrawLine(Color.Black.Opacity(o).Pen, R.Left, y, R.Right, y)
			o /= 2
		Next
		'BackgroundImage = B
		'BackgroundImageLayout = ImageLayout.Tile
	End Sub

	Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
		'pevent.Graphics.FillRectangle(Color.Black.Opacity(64).Brush, ClientRectangle)
	End Sub

	Protected Overrides Sub OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs)
		MyBase.OnPaint(pe)
		'pe.Graphics.Clear(Color.Transparent)
	End Sub

	Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
		Get
			Dim cp As CreateParams = MyBase.CreateParams
			cp.ExStyle = cp.ExStyle Or &H20	' Turn on WS_EX_TRANSPARENT
			Return cp
		End Get
	End Property

End Class